// JavaScript By Lafot 20091018
function switchPic(screen) {
	if (screen > MaxScreen) {
		screen = 1 ;
	}
	for (i=1;i<=MaxScreen;i++) {
		$("#Switch_"+i)
		.fadeOut("slow")
		.css
		({display: "none"});
	}
	$("#Switch_"+ screen)
	.fadeIn("slow")
	.css
	({display: "block"});
	
	showSwitchNav(screen);
	CurScreen = screen  ;
}
function showSwitchNav(screen) {
	var NavStr = "" ;
	for (i=1;i<=MaxScreen;i++) {
		if (i == screen) {
			NavStr += '<li onmouseover="pauseSwitch();" onmouseout="goonSwitch();"><a href="javascript:void(0);" target="_self" class="sel">'+i+'</a></li>' ;
		}
		else {
			NavStr += '<li onmouseover="goManSwitch('+i+');" onmouseout="goonSwitch();" ><a href="javascript:void(0);" target="_self">'+i+'</a></li>' ;
		}
	}
	$("#SwitchNav").html(NavStr);
}
function reSwitchPic() {
	refreshSwitchTimer = null;
	switchPic(CurScreen+1);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 5000);
}
function pauseSwitch() {
	clearTimeout(refreshSwitchTimer);
}

function goonSwitch() {
	clearTimeout(refreshSwitchTimer);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 5000);
}
function goManSwitch(index) {
	clearTimeout(refreshSwitchTimer);
	CurScreen = index - 1 ;
	reSwitchPic();
}
